package com.hdit.guimei.service.impl;

import com.hdit.guimei.domain.Address;
import com.hdit.guimei.mapper.AddressMapper;
import com.hdit.guimei.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 张宝玉
 * @date 2021/1/18 15:07
 */
@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    public AddressMapper addressMapper;
    @Override
    public int addaddress(Address address) {
        int i = addressMapper.addaddress(address);
        return i;
    }

    @Override
    public int deleaddress(String aid) {
        int i = addressMapper.deleaddress(aid);
        return i;
    }

    @Override
    public int updateaddress(int id, String address) {
        int i = addressMapper.updateadddress(address, id);
        return i;
    }

    @Override
    public Address findaddressbyid(int id) {
        Address address1 = addressMapper.findaddressbyid(id);
        return address1;
    }

    @Override
    public Address findaddressbyname(String consignee_name) {
        Address address2 = addressMapper.findaddressbyname(consignee_name);
        return address2;
    }

    @Override
    public List<Address> findAllAddress() {
        return addressMapper.findAllAddress();
    }
}
